API: gdk: Make gdk_display_get_window_at_device_position() a device API
authorBenjamin Otte <otte@redhat.com>
Mon, 27 Dec 2010 17:45:39 +0000 (18:45 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 27 Dec 2010 17:46:41 +0000 (18:46 +0100)
It's now called gdk_device_get_window_at_position(). It doesn't make
sense to keep device-specific API part of the display.

docs/reference/gdk/gdk3-sections.txt
gdk/gdk.symbols
gdk/gdkdevice.c
gdk/gdkdevice.h
gdk/gdkdisplay.c
gdk/gdkdisplay.h
gdk/gdkwindow.c
gtk/gtkcolorsel.c
gtk/gtktooltip.c

index b1141d67696ac17d1578a442d56381db5f0c4fc6..121e6fc64e1bdb3d788004a90d601331c44677af 100644 (file)
@@ -126,7 +126,6 @@ gdk_display_set_double_click_distance
 gdk_display_get_pointer
 gdk_display_list_devices
 gdk_display_get_window_at_pointer
-gdk_display_get_window_at_device_position
 GdkDisplayPointerHooks
 gdk_display_set_pointer_hooks
 GdkDisplayDeviceHooks
@@ -705,6 +704,7 @@ gdk_device_ungrab
 <SUBSECTION>
 gdk_device_get_state
 gdk_device_get_position
+gdk_device_get_window_at_position
 gdk_device_get_history
 gdk_device_free_history
 GdkTimeCoord
index 7545fe20672fcfbfa2cdafe52f0ee2d7215bb778..d23f75390f9026273f22c000c6efd68dbce875a9 100644 (file)
@@ -63,6 +63,7 @@ gdk_device_get_position
 gdk_device_get_source
 gdk_device_get_state
 gdk_device_get_type G_GNUC_CONST
+gdk_device_get_window_at_position
 gdk_device_grab
 gdk_device_grab_info_libgtk_only
 gdk_device_list_axes
@@ -97,7 +98,6 @@ gdk_display_get_n_screens
 gdk_display_get_pointer
 gdk_display_get_screen
 gdk_display_get_type G_GNUC_CONST
-gdk_display_get_window_at_device_position
 gdk_display_get_window_at_pointer
 gdk_display_has_pending
 gdk_display_is_closed
index 39af300213e95d33995f0d2d0f80754bf40dcd84..8d23314f388e9f4f64df6347992b3c9fb68698e0 100644 (file)
@@ -435,6 +435,45 @@ gdk_device_get_position (GdkDevice        *device,
     *y = tmp_y;
 }
 
+/**
+ * gdk_device_get_window_at_position:
+ * @device: pointer #GdkDevice to query info to.
+ * @win_x: (out) (allow-none): return location for the X coordinate of the device location,
+ *         relative to the window origin, or %NULL.
+ * @win_y: (out) (allow-none): return location for the Y coordinate of the device location,
+ *         relative to the window origin, or %NULL.
+ *
+ * Obtains the window underneath @device, returning the location of the device in @win_x and @win_y. Returns
+ * %NULL if the window tree under @device is not known to GDK (for example, belongs to another application).
+ *
+ * Returns: (transfer none): the #GdkWindow under the device position, or %NULL.
+ *
+ * Since: 3.0
+ **/
+GdkWindow *
+gdk_device_get_window_at_position (GdkDevice  *device,
+                                   gint       *win_x,
+                                   gint       *win_y)
+{
+  GdkDisplay *display;
+  gint tmp_x, tmp_y;
+  GdkWindow *window;
+
+  g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
+  g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
+
+  display = gdk_device_get_display (device);
+
+  window = display->device_hooks->window_at_device_position (display, device, &tmp_x, &tmp_y);
+
+  if (win_x)
+    *win_x = tmp_x;
+  if (win_y)
+    *win_y = tmp_y;
+
+  return window;
+}
+
 /**
  * gdk_device_get_history:
  * @device: a #GdkDevice
index ecce89a338e7cd1f4c853dfec285ebf0a82f1f2f..3cc15e39f59d0333d433eb762f1631043a069ecd 100644 (file)
@@ -193,6 +193,11 @@ void     gdk_device_get_position (GdkDevice         *device,
                                   GdkScreen        **screen,
                                   gint              *x,
                                   gint              *y);
+GdkWindow *
+         gdk_device_get_window_at_position
+                                 (GdkDevice         *device,
+                                  gint              *win_x,
+                                  gint              *win_y);
 gboolean gdk_device_get_history  (GdkDevice         *device,
                                   GdkWindow         *window,
                                   guint32            start,
index e7f7fc57e80f221179ab09e34558e0ccd0b3bfb5..fdd98604bad174c3ac4af6753501e9b15b995df9 100644 (file)
@@ -696,45 +696,6 @@ _gdk_display_enable_motion_hints (GdkDisplay *display,
     }
 }
 
-/**
- * gdk_display_get_window_at_device_position:
- * @display: a #GdkDisplay.
- * @device: pointer #GdkDevice to query info to.
- * @win_x: (out) (allow-none): return location for the X coordinate of the device location,
- *         relative to the window origin, or %NULL.
- * @win_y: (out) (allow-none): return location for the Y coordinate of the device location,
- *         relative to the window origin, or %NULL.
- *
- * Obtains the window underneath @device, returning the location of the device in @win_x and @win_y. Returns
- * %NULL if the window tree under @device is not known to GDK (for example, belongs to another application).
- *
- * Returns: (transfer none): the #GdkWindow under the device position, or %NULL.
- *
- * Since: 3.0
- **/
-GdkWindow *
-gdk_display_get_window_at_device_position (GdkDisplay *display,
-                                           GdkDevice  *device,
-                                           gint       *win_x,
-                                           gint       *win_y)
-{
-  gint tmp_x, tmp_y;
-  GdkWindow *window;
-
-  g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
-  g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
-  g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
-
-  window = display->device_hooks->window_at_device_position (display, device, &tmp_x, &tmp_y);
-
-  if (win_x)
-    *win_x = tmp_x;
-  if (win_y)
-    *win_y = tmp_y;
-
-  return window;
-}
-
 /**
  * gdk_display_set_device_hooks:
  * @display: a #GdkDisplay.
@@ -890,7 +851,7 @@ gdk_window_real_window_get_device_position (GdkDisplay       *display,
  *
  * Since: 2.2
  *
- * Deprecated: 3.0: Use gdk_display_get_window_at_device_position() instead.
+ * Deprecated: 3.0: Use gdk_device_get_window_at_position() instead.
  **/
 GdkWindow *
 gdk_display_get_window_at_pointer (GdkDisplay *display,
@@ -899,7 +860,7 @@ gdk_display_get_window_at_pointer (GdkDisplay *display,
 {
   g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
 
-  return gdk_display_get_window_at_device_position (display, display->core_pointer, win_x, win_y);
+  return gdk_device_get_window_at_position (display->core_pointer, win_x, win_y);
 }
 
 static void
index 100b9c37e18a1a9b321afdcd3cfbc0d2f7fed683..c782c246ecd7a97253496339c0c2763b8ba4892a 100644 (file)
@@ -191,11 +191,6 @@ GdkDisplayPointerHooks *gdk_display_set_pointer_hooks (GdkDisplay
 #endif /* GDK_DISABLE_DEPRECATED */
 #endif /* GDK_MULTIDEVICE_SAFE */
 
-GdkWindow *      gdk_display_get_window_at_device_position (GdkDisplay            *display,
-                                                            GdkDevice             *device,
-                                                            gint                  *win_x,
-                                                            gint                  *win_y);
-
 GdkDisplayDeviceHooks *gdk_display_set_device_hooks (GdkDisplay                  *display,
                                                      const GdkDisplayDeviceHooks *new_hooks);
 
index 359706be7a82613972b4e80447ee15b74cda1e78..260746c99047dfa86c9e16df4b492fa52f4fba84 100644 (file)
@@ -4951,8 +4951,7 @@ gdk_window_get_pointer (GdkWindow   *window,
  * corner of @window.
  *
  * Return value: (transfer none): The window underneath @device (as with
- * gdk_display_get_window_at_device_position()), or %NULL if the
- * window is not known to GDK.
+ * gdk_device_get_window_at_position()), or %NULL if the window is not known to GDK.
  *
  * Since: 3.0
  **/
@@ -5007,7 +5006,7 @@ gdk_window_get_device_position (GdkWindow       *window,
  *
  * Return value: (transfer none): window under the mouse pointer
  *
- * Deprecated: 3.0: Use gdk_display_get_window_at_device_position() instead.
+ * Deprecated: 3.0: Use gdk_device_get_window_at_position() instead.
  **/
 GdkWindow*
 gdk_window_at_pointer (gint *win_x,
index b6a4e4e98cbaa48f0ea4e291896dbef8616be069..983150652155d457b9a3ad66c1e5be7779d759e9 100644 (file)
@@ -1710,8 +1710,7 @@ grab_color_at_pointer (GdkScreen *screen,
   if (!pixbuf)
     {
       gint x, y;
-      GdkDisplay *display = gdk_screen_get_display (screen);
-      GdkWindow *window = gdk_display_get_window_at_device_position (display, device, &x, &y);
+      GdkWindow *window = gdk_device_get_window_at_position (device, &x, &y);
       if (!window)
        return;
       pixbuf = gdk_pixbuf_get_from_window (window,
index 3520128da4f0c7a4dd59da6b751e66e28ea460d4..8c4ef8987f24462e1fb96df3321e9672df97e32d 100644 (file)
@@ -536,9 +536,7 @@ gtk_tooltip_trigger_tooltip_query (GdkDisplay *display)
 
   /* Trigger logic as if the mouse moved */
   device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (display));
-  window = gdk_display_get_window_at_device_position (display,
-                                                      device,
-                                                      &x, &y);
+  window = gdk_device_get_window_at_position (device, &x, &y);
   if (!window)
     return;